const path = require("path");
const express = require("express");
const configs = require("./configs");
const middleware = require("./middleware");
const Userrouter = require("./routes/user");
const AdminRouter = require("./routes/admin");
const app = express();
app.use(middleware.sendJson());
app.use(express.json()); // 将请求体中的数据放置到req.body中

// 挂载路由
app.use(Userrouter);
app.use(AdminRouter);
app.listen(configs.port, configs.bindIp, () => {
  console.log(`http server is running on ${configs.bindIp}:${configs.port}`);
});
